
package com.tvunetworks.center.user.util;

import com.tvunetworks.center.common.util.CallerBlocksPolicy;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;


/**
 * @author Etan Yang
 * @data: 2021/7/1 10:28
 * @program: tvucc-playout
 * @description:
 */

public class ThreadPoolUtil {


/**
     *
     */

    public  static  final ExecutorService THREAD_POOL = new ThreadPoolExecutor(
            5,
            100,
            60L, TimeUnit.SECONDS,
            new ArrayBlockingQueue(1000),
            new CallerBlocksPolicy(Long.MAX_VALUE));


/**
     *
     * @param command 参数
     */

    public static void execute(Runnable command){
        THREAD_POOL.execute(command);
    }

}

